{extend name='common@layout/base' /}
{block name='breadcrumb'}
<?php
$cate1 = config('mall_cate')[$goods['gc_id_1']];
$cate2 = $cate1['_child'][$goods['gc_id_2']];
?>
<div class="nch-breadcrumb-layout">
    <div class="nch-breadcrumb wrapper"><i class="icon-home"></i>
        <span><a href="/">首页</a></span><span class="arrow">></span>
        <span><a href="{:url('index/goods/index', ['tag' => $cate1['tag']])}">{$cate1.name}</a></span><span class="arrow">></span>
        <span><a href="{:url('index/goods/index', ['tag' => $cate2['tag']])}">{$cate2.name}</a></span><span class="arrow">></span>
        <span>{$goods.goods_name} {$other_name}</span>
    </div>
</div>
{/block}
{block name='content'}
<link href="/old/shop/templates/new20160622/css/home_goods.css" rel="stylesheet" type="text/css">
<style type="text/css">
    .ncs-goods-picture .levelB, .ncs-goods-picture .levelC { cursor: url(/old/shop/templates/new20160622/images/shop/zoom.cur), pointer;}
    .ncs-goods-picture .levelD { cursor: url(/old/shop/templates/new20160622/images/shop/hand.cur), move\9;}
    .ncs-goods-title-nav ul{
        background: white !important;
        border: 1px solid #EEE !important;
    }
    .ncs-goods-title-nav ul li.current{

    }
    .ncs-goods-title-nav ul li.current a{
        background-color: #EC5171 !important;
        color: white !important;
    }
    .ncs-goods-title-nav{
        margin-top: 0 !important;
    }
    .ncs-goods-title-nav ul li{
        margin: 0 !important;
        border: none important;
    }
    .ncs-goods-title-nav ul li a{
        padding: 10px 15px 9px 15px !important;
        border: none !important;
        border-right: 1px solid #EEE !important;
        background: white !important;
    }
    .new_blue_btn {
        background: rgb(74,110,156) !important;
        color: white !important;
        border: 1px solid rgb(74,110,156) !important;
    }
    .new_blue_btn:hover,
    .new_blue_btn:focus,
    .new_blue_btn.focus,
    .new_blue_btn:active,
    .new_blue_btn.active {
        color: #fff !important;
        background-color: rgb(61, 80, 105) !important;
        border-color: rgb(61, 80, 105) !important;
    }
    .new_blue_btn:active,
    .new_blue_btn.active {
        background-image: none !important;
    }
</style>
<div id="content" class="wrapper pr">
    <input type="hidden" id="lockcompare" value="unlock" />
  <div style="border-right: 0px solid white !important;border-left: 0px solid white !important;border-bottom: 0px solid white !important;margin-bottom: 0 !important;min-height: 378px !important;" class="ncs-detail<?php if ($store_info['is_own_shop']) echo ' ownshop'; ?>">
    <div id="ncs-goods-picture" class="ncs-goods-picture image_zoom">
    		<div style="width: 360px;box-sizing: border-box;height: 360px;overflow:hidden;" class="new_border">
    			<img alt="<?php echo $goods['goods_name']; ?>" src="<?php echo $goods_img1; ?>" id="new_img_all_div" style="width: 100%;height: auto;"/>
    		</div>
    </div>
    <script>
    		(function(){
    			$("#new_img_all_div").load(function(){
    				var $this = $(this),
    					width = $this.get(0).naturalWidth,
    					height = $this.get(0).naturalHeight,
    					p = width/height,
    					now_height = 360/p,
    					padding_top = (360 - now_height)/2;
    				$this.css({
    					'padding-top':padding_top+'px'
    				});
    			});
    		})();
    </script>
    <div class="ncs-goods-summary" style="box-shadow: none;background-color: white;width: 600px;margin-right: 230px;border-right: 0px solid white !important;min-height: 0px !important;margin-bottom:20px;">
      <div class="name">
        <h1><?php echo $goods['goods_name']; ?></h1>
      </div>
      <div class="ncs-meta" style="background: rgb(245,249,250);box-shadow: none;">
        <div class="rate" style="top: 15px;text-align:left;"> <a href="#ncGoodsRate">商品评分</a>
          <div class='rate-ai-star'> <em><i style=" width: <?php echo number_format(($goods_static['evaluation_scores']?:5.0)*100/5,1); ?>%;"></i></em></div>
		</div>
			
      <div class="new_ml20">
        		<p>
        			市&nbsp;场&nbsp;价：
        			<font style="text-decoration: line-through;">
        			<strong>&yen;<?php echo $goods['goods_marketprice'];?></strong></strong>
        			<strong><?php echo $goods['goods_unit'] ?></strong>
        			</font>
        		</p>
        </div>
        
        <div class="new_ml20 new_mt16">
        		<p class="now_price_p">
        		<font>商&nbsp;城&nbsp;价：</font>
        		<font style="font-size: 20px;font-weight: 600;color: #D93600;vertical-align: middle;">
            <?php if (isset($goods['title']) && $goods['title'] != '') {?>
            <span class="tag"><?php echo $goods['title'];?></span>
            <?php }?>
            <?php if (isset($goods['promotion_price']) && !empty($goods['promotion_price'])) {?>
            <strong>&yen;<?php echo $goods['promotion_price'];?></strong><em>(原售价：&yen;<?php echo $goods['goods_price'];?>)</em>
            <?php } else {?>
            <strong>&yen;<?php echo $goods['goods_price'];?></strong>
            <?php }?>
            	<strong><?php echo $goods['goods_unit'] ?></strong>
            	</font>        			
        		</p>
        </div>
        <?php if (isset($goods['promotion_type']) || $goods['have_gift'] === 'gift') {?>
        <dl>
          <dt>促销信息：</dt>
          <dd class="promotion-info">
            <?php if ($goods['promotion_type'] == 'xianshi') {?>
            <?php echo '直降：&yen;'.$goods['down_price'];?>
            <?php if($goods['lower_limit']) {?>
            <em><?php echo sprintf('最低%s件起',$goods['lower_limit']);?></em>
            <?php } ?>
            <span><?php echo $goods['explain'];?></span><br>
            <?php }?>
            <?php if ($goods['promotion_type'] == 'groupbuy') {?>
            <?php if ($goods['upper_limit']) {?>
            <em><?php echo sprintf('最多限购%s件',$goods['upper_limit']);?></em>
            <?php } ?>
            <span><?php echo $goods['remark'];?></span><br>
            <?php }?>
            <?php if ($goods['have_gift'] == 'gift') {?>
            <?php echo '赠品'?> <span>赠下方的热销商品，赠完即止</span>
            <?php }?>
          </dd>
        </dl>
        <?php }?>
      </div>
      <?php if($goods['goods_state'] != 10 && $goods['goods_verify'] == 1){?>
      <div class="ncs-key">
        <?php if (is_array($goods['spec_name'])) { ?>
        <?php foreach ($goods['spec_name'] as $key => $val) {?>
        	<div class="new_mt10 new_ml20 bfc" nctype="nc-spec">
        		<div class="new_pull_left">
        			<?php echo $val;?>：
        		</div>
        		<div class="new_pull_left">
            <?php if (is_array($goods['spec_value'][$key]) and !empty($goods['spec_value'][$key])) {?>
            <ul nctyle="ul_sign">
              <?php foreach($goods['spec_value'][$key] as $k => $v) {?>
              <?php if( $key == 1 || $key == config('city_spec_id')){?>
              <li class="sp-img"><a href="javascript:void(0);" class="<?php if (isset($goods['goods_spec'][$k])) {echo 'hovered';}?>" data-param="{valid:<?php echo $k;?>}" title="<?php echo $v;?>"><img alt="" src="<?php echo $spec_image[$k];?>" /><?php echo $v;?><i></i></a></li>
              <?php }else{?>
              <li class="sp-txt"><a href="javascript:void(0)" class="<?php if (isset($goods['goods_spec'][$k])) { echo 'hovered';} ?>" data-param="{valid:<?php echo $k;?>}"><?php echo $v;?><i></i></a></li>
              <?php }?>
              <?php }?>
            </ul>
            <?php }?>        			
        		</div>
        	</div>
        
        <?php }?>
        <?php }?>
        <?php if ($goods['is_virtual'] == 1) {?>
        <dl>
          <dt>提货方式：</dt>
          <dd>
            <ul>
              <li class="sp-txt"><a href="javascript:void(0)" class="hovered">电子兑换券<i></i></a></li>
            </ul>
          </dd>
        </dl>
        <?php }?>
        <?php if ($goods['is_virtual'] == 1) {?>
        <dl>
          <dt>有&nbsp;效&nbsp;期：</dt>
          <dd>即日起 到 <?php echo date('Y-m-d H:i:s', $goods['virtual_indate']);?></dd>
        </dl>
        <?php }else if ($goods['is_presell'] == 1) {?>
        <dl>
          <dt>预&#12288;&#12288;售：</dt>
          <dd><ul><li class="sp-txt"><a href="javascript:void(0)" class="hovered"><?php echo date('Y-m-d', $goods['presell_deliverdate']);?>&nbsp;日发货<i></i></a></li></ul></dd>
        </dl>
        <?php }?>
        <?php if ($goods['is_fcode']) {?>
        <dl>
          <dt>购买类型：</dt>
          <dd><ul><li class="sp-txt"><a href="javascript:void(0)" class="hovered">F码优先购买<i></i></a></li></ul></dd>
        </dl>
        <?php }?>
        <?php if ($goods['goods_state'] != 0 && $goods['goods_storage'] >= 0) {?>
        <div class="new_mt10 new_ml20 bfc">
        		<p class="new_pull_left">购买数量：</p>
        		<div class="new_pull_left bfc" style="width: 74px;">
        			<a href="javascript:void(0)" class="decrease new_border new_bg_gray new_pull_left new_text_center" style="width: 20px;height: 20px;border-right: 0 !important;">-</a>
        			<input style="height: 20px !important;padding: 0;" type="text" name="" id="quantity" value="1" size="3" maxlength="6" class="new_border new_pull_left text w30 new_text_center" <?php if ($goods['is_fcode'] == 1) {?>readonly<?php }?>>
            		<a href="javascript:void(0)" class="increase new_pull_left  new_border new_text_center" style="width: 20px;height: 20px;border-left: 0 !important;">+</a>
            </div> 	
        </div>
        <?php }?>
      </div>
      
        <div class="ncs-btn">
          <div nctype="goods_prompt" class="ncs-point">
            <?php if (!empty($goods['goods_spec'])) {?>
            <span class="yes">已选择 <strong><?php echo implode('，', $goods['goods_spec']);?></strong></span>
            <?php }?>
            <?php if ($goods['goods_state'] == 0 || $goods['goods_storage'] <= 0) {?>
            <span class="no"><i class="icon-exclamation-sign"></i>&nbsp;商品当前库存不足</span>
            <?php }?>
          </div>
          <?php if ($goods['goods_state'] == 0 || $goods['goods_storage'] <= 0) {?>
          <a href="javascript:void(0);" nctype="arrival_notice" class="arrival" title="到货通知">（<i class="icon-bullhorn"></i>到货通知）</a>
          <?php }?>
          <div class="clear"></div>
          
          <?php if (($goods['goods_state'] == 0 || $goods['goods_storage'] <= 0) && $goods['is_appoint'] == 1) {?>
          <div>销售时间：<?php echo date('Y-m-d H:i:s', $goods['appoint_satedate']);?></div>
          <a href="javascript:void(0);" nctype="appoint_submit" class="addcart" title="立即预约">立即预约</a>
          <?php }?>
          <a href="javascript:void(0);" nctype="buynow_submit" style="width: 120px;" class="buynow <?php if ($goods['goods_state'] == 0 || $goods['goods_storage'] <= 0 || ($goods['is_virtual'] == 1 && $goods['virtual_indate'] < time())) {?>no-buynow<?php }?> new_red_btn" title="<?php echo $goods['buynow_text'];?>"><?php echo $goods['buynow_text'];?></a>
          <?php if ($goods['cart'] == true && $goods['gc_id_2'] != 9 && !isset($buy_to_ehr)) {?>
          <a href="javascript:void(0);" nctype="addcart_submit"  style="width: 120px;" class="addcart <?php if ($goods['goods_state'] == 0 || $goods['goods_storage'] <= 0) {?>no-addcart<?php }?> new_red_border_btn" title="加入购物车 new_red_border_btn">加入购物车</a>
          <?php } ?>

          <div class="ncs-cart-popup">
            <dl>
              <dt>成功添加到购物车<a title="关闭" onClick="$('.ncs-cart-popup').css({'display':'none'});">X</a></dt>
              <dd>购物车共有 <strong id="bold_num"></strong> 种商品 总金额为：<em id="bold_mly" class="saleP"></em></dd>
              <dd class="btns">
                  <a href="javascript:void(0);" class="ncs-btn-mini ncs-btn-green" onClick="location.href='{:url('member/cart/index')}'">查看购物车</a> 
                  <a href="javascript:void(0);" class="ncs-btn-mini" value="" onClick="$('.ncs-cart-popup').css({'display':'none'});">继续购物</a>
              </dd>
            </dl>
          </div>

        </div>
      <?php }else{?>
      <div class="ncs-saleout">
        <dl>
          <dt><i class="icon-info-sign"></i>商品已下架</dt>
          <dd>1.&nbsp;请联系卖家咨询</dd>
          <dd>2.&nbsp;逛逛&nbsp;<a href="<?php echo url('index/store/index', array('store_id'=>$goods['store_id']));?>" class="ncs-btn-mini">商家店铺</a>&nbsp;选择其他商品 </dd>
        </dl>
      </div>
      <?php }?>
      	<div class="new_mt20 new_ml20">
      		<p class="new_inline-block">承诺：</p>
      		<div class="new_inline-block">
      			<img alt="50万保障" src="/old/shop/templates/new20160622/images/shop/50wanbaozhuang.png" class="new_inline-block" height="20px" />
      			<img alt="顶级服务商" src="/old/shop/templates/new20160622/images/shop/dingjifuwushang.png" class="new_inline-block" height="20px" />
      		</div>
      	</div>       	

    </div>

    <div style=" position: absolute; z-index: 1; top: 20px; right: -1px;">
      <div style="width: 192px;" class="new_border new_p10 new_pt16">
      	<div class="new_text_center">
      		<p style="color: rgb(74,110,156);font-size: 24px;" class="new_fw700">顶级服务商</p>
      	</div>
      	<div class="new_mt20">
      		<p class="new_f14"><?php echo $store_info['name']; ?></p>	
      	</div>
      	<div class="new_mt16">
      		<p class="new_inline-block new_f12 new_fc_gray">信誉：</p>
      		<div class="new_inline-block">
      			<div style="position: relative;width: 100px;height: 26px;">
      				<img alt="蓝钻" src="/old/shop/templates/new20160622/images/shop/lan_zhuang.png" style="position:absolute;top:3px;left:0px;width: 100%;" class="new_inline-block"/>
      				<div style="background: white;height: 100%;position:absolute;top:0px;right:0px;width: <?php echo 100-$store_info['store_credit_percent'];?>%;"></div>
      			</div>
      		</div>
      	</div>
      	<div class="new_mt16">
      		<p class="new_inline-block new_f12 new_fc_gray">联系：</p>
      		<div class="new_inline-block">
      			<?php if(!empty($store_info['qq'])){?>
		        <a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=<?php echo $store_info['qq'];?>&site=qq&menu=yes" title="QQ: <?php echo $store_info['qq'];?>" style="width: 60px;padding-top: 2px;padding-bottom: 2px;font-size: 12px;" class="new_btn new_red_btn" title="QQ马上咨询">马上咨询</a>
		        <?php }else{ ?>
		        <a href="#" style="width: 60px;padding-top: 2px;padding-bottom: 2px;font-size: 12px;" class="new_btn new_red_btn" title="马上咨询">马上咨询</a>	
		        <?php }?>
      		</div>
      	</div>
      	<div class="new_mt16">
      		<p class="new_inline-block new_f12 new_fc_gray">资质：</p>
      		<div class="new_inline-block">
      			<img alt="50万保障" src="/old/shop/templates/new20160622/images/shop/50wanbaozhuang.png" class="new_inline-block" style="width: 60px;"/>
      			<img alt="顶级服务商" src="/old/shop/templates/new20160622/images/shop/dingjifuwushang.png" class="new_inline-block" style="width: 60px;"/>
      		</div>
      	</div> 
      	<div class="new_pt10 new_mt16 new_text_center" style="border-top: 1px solid #E6E6E6;">
      		<a href="<?php echo url('index/store/index', array('store_id' => $store_info['id']));?>"><button class="new_btn new_blue_btn">查看服务商</button></a>
      	</div>     	      	
      </div>
    </div>
    <div class="clear"></div>
  </div>
  <div class="ncs-goods-layout expanded" >
    <div class="ncs-goods-main" id="main-nav-holder" style="float: left;width: 970px !important;">
      <div class="ncs-promotion" id="nc-bundling" style="display:none;"></div>
      <div class="tabbar pngFix" id="main-nav" style="width: 970px !important;">
        <div class="ncs-goods-title-nav">
          <ul id="categorymenu">
            <li class="current"><a id="tabGoodsIntro" href="javascript:void(0);">商品详情</a></li>
            <li><a id="tabGoodsRate" href="javascript:void(0);">商品评价<em>(<?php echo $goods_evaluate_info['all'];?>)</em></a></li>
            <li><a id="tabGoodsTraded" href="javascript:void(0);">销售记录<em>(<?php echo $goods['goods_salenum']; ?>)</em></a></li>
            </ul>
          <div class="switch-bar"><a href="javascript:void(0)" id="fold">&nbsp;</a></div>
        </div>
      </div>
      <div class="ncs-intro">
        <div class="content bd" id="ncGoodsIntro">

          <?php if($mansong_info) { ?>
          <div class="nc-mansong">
            <div class="nc-mansong-ico"></div>
            <dl class="nc-mansong-content">
              <dt><?php echo $mansong_info['mansong_name'];?>
                <time>( 活动时间：<?php echo date('Y-m-d',$mansong_info['start_time']).'--'.date('Y-m-d',$mansong_info['end_time']);?> )</time>
              </dt>
              <dd>
                <?php foreach($mansong_info['rules'] as $rule) { ?>
                <span>满<em><?php echo ncPriceFormat($rule['price']);?></em>元
                <?php if(!empty($rule['discount'])) { ?>
                ， 减<i><?php echo ncPriceFormat($rule['discount']);?></i>元
                <?php } ?>
                <?php if(!empty($rule['goods_id'])) { ?>
                ， 送礼品 <a href="<?php echo $rule['goods_url'];?>" title="<?php echo $rule['mansong_goods_name'];?>" target="_blank"> <img src="<?php echo img_url($rule['goods_image'], 60);?>" alt="<?php echo $rule['mansong_goods_name'];?>"> </a>&nbsp;。
                <?php } ?>
                </span>
                <?php } ?>
              </dd>
              <dd class="nc-mansong-remark"><?php echo $mansong_info['remark'];?></dd>
            </dl>
          </div>
          <?php } ?>
          <div class="ncs-goods-info-content">
            <?php if (isset($plate_top)) {?>
            <div class="top-template"><?php echo htmlspecialchars_decode($plate_top['plate_content'])?></div>
            <?php }?>
            <div class="default"><?php echo $goods['goods_body']; ?></div>
            <?php if (isset($plate_bottom)) {?>
            <div class="bottom-template"><?php echo htmlspecialchars_decode($plate_bottom['plate_content'])?></div>
            <?php }?>
          </div>
        </div>
      </div>
      <div class="ncs-comment">
        <div class="ncs-goods-title-bar hd">
          <h4><a href="javascript:void(0);">商品评价</a></h4>
        </div>
        <div class="ncs-goods-info-content bd" id="ncGoodsRate">
          <div class="top">
            <div class="rate" style="color: #EC5171;margin: 10px 40px 10px 0px;">
              <p><strong><?php echo $goods_evaluate_info['good_percent'];?>%</strong><sub></sub>好评</p>
              <span class="new_pl5">共有<?php echo $goods_evaluate_info['all'];?>人参与评分</span></div>
            <div class="percent">
              <dl>
                <dt>好评<em>(<?php echo $goods_evaluate_info['good_percent'];?>%)</em></dt>
                <dd><i style="width: <?php echo $goods_evaluate_info['good_percent'];?>%"></i></dd>
              </dl>
              <dl>
                <dt>中评<em>(<?php echo $goods_evaluate_info['normal_percent'];?>%)</em></dt>
                <dd><i style="width: <?php echo $goods_evaluate_info['normal_percent'];?>%"></i></dd>
              </dl>
              <dl>
                <dt>差评<em>(<?php echo $goods_evaluate_info['bad_percent'];?>%)</em></dt>
                <dd><i style="width: <?php echo $goods_evaluate_info['bad_percent'];?>%"></i></dd>
              </dl>
            </div>
            <div class="btns"><span>您可对已购商品进行评价</span>
              <p><a href="<?php if ($goods['is_virtual']) { echo url('member/order/virtual', 'index');} else { echo url('member/order/index', 'index');}?>" class="new_btn new_red_btn" style="width: 107px;margin-top: 6px;" target="_blank"><i class="icon-comment-alt"></i>评价商品</a></p>
            </div>
          </div>
          <div class="ncs-goods-title-nav">
            <ul id="comment_tab">
              <li data-type="all" class="current"><a href="javascript:void(0);">商品评价(<?php echo $goods_evaluate_info['all'];?>)</a></li>
              <li data-type="1"><a href="javascript:void(0);">好评(<?php echo $goods_evaluate_info['good'];?>)</a></li>
              <li data-type="2"><a href="javascript:void(0);">中评(<?php echo $goods_evaluate_info['normal'];?>)</a></li>
              <li data-type="3"><a href="javascript:void(0);">差评(<?php echo $goods_evaluate_info['bad'];?>)</a></li>
            </ul>
          </div>
          <div id="goodseval" class="ncs-commend-main"></div>
        </div>
      </div>
      <div class="ncg-salelog">
        <div class="ncs-goods-title-bar hd">
          <h4><a href="javascript:void(0);">销售记录</a></h4>
        </div>
        <div class="ncs-goods-info-content bd" id="ncGoodsTraded">
          <div class="top">
            <div class="price">商&nbsp;城&nbsp;价<strong><?php echo $goods['goods_price'];?></strong>元<span>购买的价格不同可能是由于店铺往期促销活动引起的，详情可以咨询卖家</span></div>
          </div>
          <div id="salelog_demo" class="ncs-loading"> </div>
        </div>
      </div>
    </div>
  	<div style="float: left;width: 212px;border: 1px solid #EEEEEE;margin-left: 16px;">
  		<div style="border-bottom: 1px solid #EEEEEE;background: rgb(245,249,250);height: 150px;" class="new_bfc">
  			<div class="new_pull_left new_w40_ new_pl10" style="box-sizing: border-box;">
  				<img alt="服务保障" src="/old/shop/templates/new20160622/images/shop/right_1.png" class="new_inline-block" style="width: 60px;padding-top: 40px;"/>
  			</div>
  			<div class="new_pull_left new_w60_" style="padding-top: 55px;">
  				<p class="new_fw700 new_f24">爱员工</p>
  				<p class="new_f14 new_mt10">服务保障</p>
  			</div>
  		</div>
  		<div style="box-sizing: border-box;padding: 0px 10px;height: 150px;" >
  			<div  class="new_bfc" style="box-sizing: border-box;border-bottom: 1px solid #EEEEEE;height: 150px;">
	  			<div class="new_pull_left new_w40_" style="box-sizing: border-box;">
	  				<img alt="资质认证" src="/old/shop/templates/new20160622/images/shop/right_2.png" class="new_inline-block" style="width: 60px;padding-top: 40px;"/>
	  			</div>
	  			<div class="new_pull_left new_w60_" style="padding-top: 40px;box-sizing: border-box;">
	  				<p class="new_fw700 new_f16" style="color: rgb(74,110,156);">资质认证</p>
	  				<p style="font-size: 10px;color: rgb(74,110,156);">实名认证职业资质</p>
	  				<p style="font-size: 10px;color: rgb(74,110,156);">3年以上执业经验</p>
	  			</div> 
  			</div> 			
  		</div>
  		<div style="box-sizing: border-box;padding: 0px 10px;height: 150px;" >
  			<div  class="new_bfc" style="box-sizing: border-box;border-bottom: 1px solid #EEEEEE;height: 150px;">
	  			<div class="new_pull_left new_w40_" style="box-sizing: border-box;">
	  				<img alt="支付安全" src="/old/shop/templates/new20160622/images/shop/right_3.png" class="new_inline-block" style="width: 60px;padding-top: 40px;"/>
	  			</div>
	  			<div class="new_pull_left new_w60_" style="padding-top: 40px;box-sizing: border-box;">
	  				<p class="new_fw700 new_f16" style="color: rgb(74,110,156);">支付安全</p>
	  				<p style="font-size: 10px;color: rgb(74,110,156);">明码标价支付有保证</p>
	  				<p style="font-size: 10px;color: rgb(74,110,156);">服务不满意全额退款</p>
	  			</div> 
  			</div> 			
  		</div>

  		<div style="box-sizing: border-box;padding: 0px 10px;height: 150px;" >
  			<div  class="new_bfc" style="box-sizing: border-box;border-bottom: 1px solid #EEEEEE;height: 150px;">
	  			<div class="new_pull_left new_w40_" style="box-sizing: border-box;">
	  				<img alt="专人服务" src="/old/shop/templates/new20160622/images/shop/right_4.png" class="new_inline-block" style="width: 60px;padding-top: 40px;"/>
	  			</div>
	  			<div class="new_pull_left new_w60_" style="padding-top: 40px;box-sizing: border-box;">
	  				<p class="new_fw700 new_f16" style="color: rgb(74,110,156);">专人服务</p>
	  				<p style="font-size: 10px;color: rgb(74,110,156);">服务专员一对一服务</p>
	  				<p style="font-size: 10px;color: rgb(74,110,156);">系统监控每个服务节点</p>
	  			</div> 
  			</div> 			
  		</div>
  		<div style="box-sizing: border-box;padding: 0px 10px;height: 150px;" >
  			<div  class="new_bfc" style="box-sizing: border-box;border-bottom: 1px solid #EEEEEE;height: 150px;">
	  			<div class="new_pull_left new_w40_" style="box-sizing: border-box;">
	  				<img alt="售后无忧" src="/old/shop/templates/new20160622/images/shop/right_5.png" class="new_inline-block" style="width: 60px;padding-top: 40px;"/>
	  			</div>
	  			<div class="new_pull_left new_w60_" style="padding-top: 40px;box-sizing: border-box;">
	  				<p class="new_fw700 new_f16" style="color: rgb(74,110,156);">售后无忧</p>
	  				<p style="font-size: 10px;color: rgb(74,110,156);">客服6x12服务反馈</p>
	  				<p style="font-size: 10px;color: rgb(74,110,156);">服务完成后续通知</p>
	  			</div> 
  			</div> 			
  		</div>  		  		  		
  	</div>    
  </div>
</div>
<form id="buynow_form" method="post" action="{:url('member/buy/step2')}">
  <input id="cart_id" name="cart_id[]" type="hidden"/>
  <input name="buy_to_ehr" value="{$buy_to_ehr|default=0}" type="hidden"/>
</form>
<script type="text/javascript" src="/old/data/resource/js/jquery.charCount.js?{$Think.config.version_source}"></script>
<script src="/old/data/resource/js/jquery.ajaxContent.pack.js?{$Think.config.version_source}" type="text/javascript"></script>
<script src="/old/data/resource/js/sns.js?{$Think.config.version_source}" type="text/javascript" charset="utf-8"></script>
<script src="/old/data/resource/js/jquery.F_slider.js?{$Think.config.version_source}" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="/old/data/resource/js/waypoints.js?{$Think.config.version_source}"></script>
<script src="/old/data/resource/js/jquery.raty/jquery.raty.min.js?{$Think.config.version_source}" type="text/javascript"></script>
<script type="text/javascript" src="/old/data/resource/js/jquery.nyroModal/custom.min.js?{$Think.config.version_source}" charset="utf-8"></script>
<link href="/old/data/resource/js/jquery.nyroModal/styles/nyroModal.css?{$Think.config.version_source}" rel="stylesheet" type="text/css" id="cssfile2" />
<script type="text/javascript">
jQuery(function($){
	return ;  
	$.getScript('/old/shop/resource/js/ImageZoom.js', function(){
		var
		zoomController,
		zoomControllerUl,
		zoomControllerUlLeft = 0,
		shell = $('#ncs-goods-picture'),
		shellPanel = shell.parent(),
		heightNcsDetail = $('div[class="ncs-detail"]').height();
		heightOffset = 60,
		minGallerySize = [360, 360],
		imageZoom = new ImageZoom({
			shell: shell,
			basePath: '',
			levelASize: [60, 60],
			levelBSize: [320, 320],
			gallerySize: minGallerySize,
			onBeforeZoom: function(index, level){
				if(!zoomController){
					zoomController = shell.find('div.controller');
				}

				var
				self = this,
				duration = 320,
				width = minGallerySize[0],
				height = minGallerySize[1],
				zoomFx = function(){
					self.ops.gallerySize = [width, height];
					self.galleryPanel.stop().animate({width:width, height:height}, duration);
					shellPanel.stop().animate({height:height + heightOffset}, duration).css('overflow', 'visible');
					zoomController.animate({width:width-22}, duration);
					shell.stop().animate({width:width}, duration);
				};
				if(level !== this.level && this.level !== 0){
					if(this.level === 1 && level > 1){
						height = Math.max(480, shellPanel.height());
						width = shellPanel.width();
						zoomFx();
					}
					else if(level === 1){
						zoomFx();
						shellPanel.stop().animate({height:heightNcsDetail}, duration);
					}
				}
			},
			onZoom: function(index, level, prevIndex){
				shell.find('a.prev,a.next')[level<3 ? 'removeClass' : 'addClass']('hide');
				shell.find('a.close').css('display', [level>1 ? 'block' : 'none']);
			},
			items: [
	                <?php if (!empty($goods_image)) {?>
	                <?php echo implode(',', $goods_image);?>
	                <?php }?>
					]
		});
		shell.data('imageZoom', imageZoom);
	});

});

    jQuery.divselect = function(divselectid,inputselectid) {
      var inputselect = $(inputselectid);
      $(divselectid).mouseover(function(){
          var ul = $(divselectid+" ul");
          ul.slideDown("fast");
          if(ul.css("display")=="none"){
              ul.slideDown("fast");
          }
      });
      $(divselectid).live('mouseleave',function(){
          $(divselectid+" ul").hide();
      });
    };
$(function(){
	$('#ncsGoodsGift').perfectScrollbar();
    <?php if ($goods['goods_state'] == 1 && $goods['goods_storage'] > 0 ) {?>
    $('a[nctype="addcart_submit"]').click(function(){
        addcart(<?php echo $goods['goods_id'];?>, checkQuantity(),'addcart_callback');
    });
	<?php if ($goods['gc_id_2']==9 && config('member_id') > 0) {?>
	$('a[nctype="buynow_submit"]').click(function(){
		window.open("http://web.aiyuangong.com/shoplogin.html?accountId=<?php echo config('member_id');?>&token=");
	});
	<?php }?>
        <?php if (!($goods['gc_id_2']==9 && config('member_id') > 0) && !($goods['is_virtual'] == 1 && $goods['virtual_indate'] < time())) {?>
        $('a[nctype="buynow_submit"]').click(function(){
            buynow(<?php echo $goods['goods_id']?>,checkQuantity());
        });
        <?php }?>
    <?php }?>
    <?php if ($goods['goods_storage'] == 0 || $goods['goods_state'] == 0) {?>
    $('a[nctype="arrival_notice"]').click(function(){
        <?php if (config('member_id') < 1){?>
        login_dialog();
        <?php }else{?>
        ajax_form('arrival_notice', '到货通知','<?php echo url('index/goods/arrival_notice', array('goods_id' => $goods['goods_id']));?>', 350);
        <?php }?>
    });
    <?php }?>
    <?php if (($goods['goods_state'] == 0 || $goods['goods_storage'] <= 0) && $goods['is_appoint'] == 1) {?>
    $('a[nctype="appoint_submit"]').click(function(){
        <?php if (config('member_id') < 1){?>
        login_dialog();
        <?php }else{?>
        ajax_form('arrival_notice', '立即预约', '<?php echo url('index/goods/arrival_notice', array('goods_id' => $goods['goods_id'], 'type' => 2));?>', 350);
        <?php }?>
    });
    <?php }?>
    $('#main-nav').waypoint(function(event, direction) {
        $(this).parent().parent().parent().toggleClass('sticky', direction === "down");
        event.stopPropagation();
    });

    $.divselect("#handle-l");
    $.divselect("#handle-r");

    $('div[nctype="nc-spec"]').find('a').each(function(){
        $(this).click(function(){
            if ($(this).hasClass('hovered')) {
                return false;
            }
            $(this).parents('ul:first').find('a').removeClass('hovered');
            $(this).addClass('hovered');
            checkSpec();
        });
    });

});

function checkSpec() {
    var spec_param = <?php echo $spec_list;?>;
    var spec = new Array();
    $('ul[nctyle="ul_sign"]').find('.hovered').each(function(){
        var data_str = ''; eval('data_str =' + $(this).attr('data-param'));
        spec.push(data_str.valid);
    });
    var spec1 = spec.sort(function(a,b){
        return a-b;
    }); 
    var spec_sign = spec1.join('|');
    $.each(spec_param, function(i, n){
        if (n.sign == spec_sign) {
            window.location.href = n.url;
        }
    });
}

function checkQuantity(){
    var quantity = parseInt($("#quantity").val());
    if (quantity < 1) {
        alert("请填写购买数量");
        $("#quantity").val('1');
        return false;
    }
	max = 9999999;
    <?php if ($goods['is_virtual'] == 1 && $goods['virtual_limit'] > 0) {?>
    max = <?php echo $goods['virtual_limit'];?>;
    if(quantity > max){
        alert('最多限购'+max+'件');
        return false;
    }
    <?php } ?>
    <?php if (!empty($goods['upper_limit'])) {?>
    max = <?php echo $goods['upper_limit'];?>;
    if(quantity > max){
        alert('最多限购'+max+'件');
        return false;
    }
    <?php } ?>
    if(quantity > max){
        alert("库存不足");
        return false;
    }
    return quantity;
}

function buynow(goods_id,quantity){
<?php if (config('member_id') < 1){?>
	login_dialog();
<?php }else{?>
    if (!quantity) {
        return;
    }
    <?php if (config('store_id') == $goods['store_id']) { ?>
    alert('不能购买自己店铺的商品');return;
    <?php } ?>
    $("#cart_id").val(goods_id+'|'+quantity);
    $("#buynow_form").submit();
<?php }?>
}

$(function(){
    $('#transport_pannel>a').click(function(){
    	var id = $(this).attr('nctype');
    	if (id=='undefined') return false;
    	var _self = this,tpl_id = '<?php echo $goods['transport_id'];?>';
	    var url = 'index.php?act=goods&op=calc&rand='+Math.random();
	    $('#transport_price').css('display','none');
	    $('#loading_price').css('display','');
	    $.getJSON(url, {'id':id,'tid':tpl_id}, function(data){
	    	if (data == null) return false;
	        if(data != 'undefined') {$('#nc_kd').html('运费：<em>' + data + '</em>元');}else{'卖家承担运费';}
	        $('#transport_price').css('display','');
	    	$('#loading_price').css('display','none');
	        $('#ncrecive').html($(_self).html());
	    });
    });
    $("#nc-bundling").load('/?s=index/goods/get_bundling&goods_id=<?php echo $goods['goods_id'];?>', function(){
        if($(this).html() != '') {
            $(this).show();
        }
    });
    $("#salelog_demo").load('/?s=index/goods/common_salelog&common_id=<?php echo $goods['commonid'];?>&store_id=<?php echo $goods['store_id'];?>&vr=<?php echo $goods['is_virtual'];?>', function(){
     
        $(this).find('[nctype="mcard"]').membershipCard({type:'shop'});
    });
	$("#consulting_demo").load('index.php?act=goods&op=consulting&goods_id=<?php echo $goods['goods_id'];?>&store_id=<?php echo $goods['store_id'];?>', function(){
		$(this).find('[nctype="mcard"]').membershipCard({type:'shop'});
	});

	$('#fold').click(function(){
  		$('.ncs-goods-layout').toggleClass('expanded');
	});
	$('#categorymenu').find("li").click(function(){
		$('#categorymenu').find("li").removeClass('current');
		$(this).addClass('current');
	});
	$('#tabGoodsIntro').click(function(){
		$('.bd').css('display','');
		$('.hd').css('display','');
	});
	$('#tabGoodsRate').click(function(){
		$('.bd').css('display','none');
		$('#ncGoodsRate').css('display','');
		$('.hd').css('display','none');
	});
	$('#tabGoodsTraded').click(function(){
		$('.bd').css('display','none');
		$('#ncGoodsTraded').css('display','');
		$('.hd').css('display','none');
	});
	$('#tabGuestbook').click(function(){
		$('.bd').css('display','none');
		$('#ncGuestbook').css('display','');
		$('.hd').css('display','none');
	});
	$(".ncs-top-tab > li > a").mouseover(function(e) {
		if (e.target == this) {
			var tabs = $(this).parent().parent().children("li");
			var panels = $(this).parent().parent().parent().children(".ncs-top-panel");
			var index = $.inArray(this, $(this).parent().parent().find("a"));
			if (panels.eq(index)[0]) {
				tabs.removeClass("current ").eq(index).addClass("current ");
				panels.addClass("hide").eq(index).removeClass("hide");
			}
		}
	});
	$(".ncs-rate-tab > li > a").mouseover(function(e) {
		if (e.target == this) {
			var tabs = $(this).parent().parent().children("li");
			var panels = $(this).parent().parent().parent().children(".ncs-rate-panel");
			var index = $.inArray(this, $(this).parent().parent().find("a"));
			if (panels.eq(index)[0]) {
				tabs.removeClass("current ").eq(index).addClass("current ");
				panels.addClass("hide").eq(index).removeClass("hide");
			}
		}
	});

	$('.goods-pic > .thumb').hover(
		function(){
			$(this).next().css('display','block');
		},
		function(){
			$(this).next().css('display','none');
		}
	);

	$('.increase').click(function(){
		num = parseInt($('#quantity').val());
	    <?php if ($goods['is_virtual'] == 1 && $goods['virtual_limit'] > 0) {?>
	    max = <?php echo $goods['virtual_limit'];?>;
	    if(num >= max){
	        alert('最多限购'+max+'件');
	        return false;
	    }
	    <?php } ?>
	    <?php if (!empty($goods['upper_limit'])) {?>
	    max = <?php echo $goods['upper_limit'];?>;
	    if(num >= max){
	        alert('最多限购'+max+'件');
	        return false;
	    }
	    <?php } ?>
		max = 9999999;
		if(num < max){
			$('#quantity').val(num+1);
		}
	});
	$('.decrease').click(function(){
		num = parseInt($('#quantity').val());
		if(num > 1){
			$('#quantity').val(num-1);
		}
	});

    $('#comment_tab').on('click', 'li', function() {
        $('#comment_tab li').removeClass('current');
        $(this).addClass('current');
        load_goodseval($(this).attr('data-type'));
    });
    load_goodseval('all');
    function load_goodseval(type) {
        var url = '/?s=index/goods/common_comments&commonid=<?php echo $goods['commonid'];?>&type=' + type;
        $("#goodseval").load(url, function(){
            $(this).find('[nctype="mcard"]').membershipCard({type:'shop'});
        });
    }

	$.get("/?s=index/goods/addbrowse",{gid:<?php echo $goods['goods_id'];?>});
	initCompare();
});
function addcart_callback(data){
	$('#bold_num').html(data.num);
    $('#bold_mly').html(price_format(data.amount));
    $('.ncs-cart-popup').fadeIn('fast');
}
var select_js = {};
select_js.data = [];
select_js.init = function(){
	
}
</script>
{/block}